import {RouteRecordRaw} from 'vue-router'

export const routes: RouteRecordRaw[] = [
    {
        path: '/super',
        name: 'super',
        component: () => import('@/views/super/super.vue'),
        redirect: '/',
        children: [
            {
                path: '/',
                name: 'layout',
                component: () => import('@/views/layout/layout.vue'),
                redirect: '/home',
                children: [
                    {
                        path: '/home',
                        name: 'home',
                        component: () => import('@/views/home/home.vue'),
                    },
                    {
                        path: '/manage',
                        name: 'manage',
                        children: [
                            {
                                path: '/manage/article',
                                name: 'article',
                                component: () => import('@/views/manage/article/manage_article.vue'),
                            },
                            {
                                path: '/manage/material',
                                name: 'tag',
                                component: () => import('@/views/manage/material/material.vue'),
                            }
                        ]
                    },
                    {
                        path: '/user',
                        name: 'user',
                        children: [
                            {
                                path: '/user/info',
                                name: 'userInfo',
                                component: () => import('@/views/user/info/user.vue'),
                            }
                        ]
                    },
                ]
            },
        ]
    },
    {
        path: '/creation',
        name: 'creation',
        component: () => import('@/views/super/super.vue'),
        children: [
            {
                path: '/creation/article',
                name: 'articleCreation',
                component: () => import('@/views/creation/article/article.vue'),
            }
        ]
    },
    {
        path: '/login',
        name: 'login',
        component: () => import('@/views/login/login.vue'),
    },
    {
        path: '/:pathMatch(.*)*',
        name: '404',
        component:
            () => import('@/views/error/404.vue'),
    }
]
